//part1:C07:ex7.1.cpp
#include <iostream>
#include "Sales_data.h"
using namespace std;

int main(void)
{
    cout <<"Enter sales records:(ISBN, volume, soureprice, realprice)\n";
    Sales_data total;

    if (cin >> total)
    {
        Sales_data trans;
        while (cin >> trans)
        {
            if (total.isbn() == trans.isbn())
            {
                total += trans;
            }
            else
            {
                cout << total << endl;
                total = trans;
            }
        }
        cout << total << endl;
    }
    else
    {
        cerr << "No data?!" << endl;
        return -1;
    }

    return 0;

}
